function isEmpty (obj) {
    return obj === null || obj === '' || obj === undefined;
}

/**
 * 替换输入数字的位数
 * @param value 
 * @param type 
 */
const utilTransferInputValue = (value: string, type: 'price' | 'amount') => {
    value = value.replace(/[^\d\.]/g, '');
    value = value.replace(/^\./g, '');
    value = value.replace(/^0{2,}/, '0');
    value = value.replace(/^0\d+/, (match) => {
        return match.slice(1);
    });
    value = value.replace(/\.{2,}/g, '.');
    value = value.replace('.', '$#$').replace(/\./g, '').replace('$#$', '.');
    value = value.replace(/(\.\d*)/, (match, p1) => {
        p1 = p1.slice(0, 5);
        return p1;
    });

    value = value.replace(/\d*/, (match, p1) => {
        return match.slice(0, 6);
    });
    return value;
}

export {
    isEmpty,
    utilTransferInputValue
}